package it.koutifaris.travianmap.view.serversview;

import it.koutifaris.travianmap.R;
import it.koutifaris.travianmap.context.ContextRetreiver;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;

public class ServersActivity extends Activity {

	public static void startActivity(Activity currentActivity) {
		Intent intent = new Intent(currentActivity, ServersActivity.class);
		currentActivity.startActivity(intent);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ContextRetreiver.contextRetreiver().setCurrentContext(this);
		new ServersViewController().show();
	}

	@Override
	protected void onRestart() {
		super.onRestart();
		ContextRetreiver.contextRetreiver().setCurrentContext(this);
		new ServersViewController().show();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.servers_add_menu, menu);
		return true;
	}

	@Override
	public boolean onPrepareOptionsMenu(Menu menu) {
		new ServersViewController().prepareMenu(menu);
		return true;
	}

}
